Action When Enter-key is Pressed on NSTextField

Add Action in NSTextField’s Delegate

1
2
3
@IBAction func textFieldAction(sender: NSTextField) {
print(sender.stringValue)
}

Connect NSTextField’s Action to Delegate’s One

Set NSTextField’s Action Type